IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[cms_sp_MediaContentFileLinkAdd]') AND type in (N'P', N'PC'))
	DROP PROCEDURE [dbo].[cms_sp_MediaContentFileLinkAdd]
GO
create procedure [dbo].[cms_sp_MediaContentFileLinkAdd]
(
@Id int = null output,
@MediaContentId int,
@MediaFileId int,
@IsPrimary bit
)
as

insert into [dbo].[MediaContentFileLinks](
[MediaContentId]
,[MediaFileId]
,[IsPrimary]
)
values(
@MediaContentId
,@MediaFileId
,@IsPrimary
)

set @Id = SCOPE_IDENTITY()
return @Id

GO

